package com.zhl.hadoop.mapreduce.wordcount;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

/**
 * @program: demos
 * @description:
 * @author: 刘振华
 * @create: 2020-10-28 11:11
 **/
public class MyReduce extends Reducer<Text, LongWritable,Text,LongWritable> {

	@Override
	protected void reduce(Text key, Iterable<LongWritable> values, Context context) throws IOException, InterruptedException {
		int time = 0;
		for (LongWritable value : values) {
			time++;
		}
		context.write(key,new LongWritable(time));
	}
}
